<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Document</title>
        <style>
            * {
                margin: 0;
                padding: 0;
            }
            .banner {
                background: black;
            }
            img {
                width: 100%;
                /* display: block;  */
                /* vertical-align: bottom; */
            }
            section {
                height: 300px;
                background: #00b3ff;
            }
        </style>
    </head>
    <body>
        <div class="banner">
            <img
                src=""
                alt="banner"
            />
        </div>
        <!-- 
            现象：包裹img元素的div下会出现白条
            原因：img是inline元素，vertical-align：baseline 所以会出现白条
            解决办法：将img改为display:block; 或者 vertical-align: bottom;
         -->
    </body>
</html>
